package models.PokerTP;

public class PlayerInfo {
	private Player thisPlayer;
	private long playerId;
	boolean isbot = false;
	private boolean readyToStart = false;
	private long assignmentTable = 0;
	private String playerName;
	
	public PlayerInfo(Bot bot) {
		if(bot == null) throw new NullPointerException();
		thisPlayer = bot;
		isbot = true;
	}
	
	public PlayerInfo(Bot2 bot) {
		if(bot == null) throw new NullPointerException();
		thisPlayer = bot;
		isbot = true;
	}
	
	public PlayerInfo(long playerId, Human p) {
		if(playerId == 0) throw new Blad("playerId nie moze byc 0");
		this.playerId = playerId;
		if(p == null) throw new NullPointerException();
		thisPlayer = p;
	}
	
	public void setTokens(int count) {
		thisPlayer.cash = count;
	}
	
	public int getTokens() {
		return thisPlayer.cash;
	}
	
	public Player getPlayer() {
		return thisPlayer;
	}
	
	public String getCardsString() {
		return String.format("%s;%s;%s;%s;%s", thisPlayer.karty[0],
				thisPlayer.karty[1], thisPlayer.karty[2], thisPlayer.karty[3],
				thisPlayer.karty[4]);
	}
	
	public boolean isComputer() { return isbot; }

	public boolean isReadyToStart() {
		return readyToStart;
	}

	public void setReadyToStart(boolean readyToStart) {
		this.readyToStart = readyToStart;
	}

	public long getPlayerId() {
		return playerId;
	}

	public String getPlayerName() {
		return playerName;
	}

	public void setPlayerName(String playerName) {
		this.playerName = playerName;
	}

	public long getAssignmentTable() {
		return assignmentTable;
	}

	public void setAssignmentTable(long assignmentTable) {
		this.assignmentTable = assignmentTable;
	}
}
